<template>
	<!--我的工作-->
	<view class="page-content" @touchstart="refreshStart" @touchmove="refreshMove" @touchend="refreshEnd">
		<!-- 刷新组件需搭配scroll-view使用，并在pages.json中添加 "disableScroll":true-->
		<refresh ref="refresh" @isRefresh="isRefresh"></refresh>
		<view class="page-top">
			<!-- 标题栏和状态栏占位符 -->
			<view class="titleNview-placing"></view>
			<w-sel-search topType="two" :is_back_index="true" leftIcon="arrowleft" iconfont="28" :pageobj="pageobj" @selectRadioLabel="selectRadioLabel" @resetFilterData="resetFilterData" @search="search"
				@setFilterData="setFilterData">
			</w-sel-search>
			<!-- 导航栏 agents导航栏标题 -->
			<nav-tab ref="navTab" :tabTitle="tabTitle" @changeTab="changeTab" :active="currentTab" fontS="28" afontS="32" :is_num_show="true"
				:ld_num="ld_num" :cy_num="cy_num"></nav-tab>
		</view>
		<!-- swiper切换 swiper-item表示一页 scroll-view表示滚动视窗 -->
		<swiper class="page-body" :current="currentTab" @change="swiperTab">
			<swiper-item v-for="(item,index) in objlist" :key="index">
				<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="lower1" scroll-with-animation
					:scroll-into-view="toView">
					<template v-if="item && item.length > 0 ">
						<template v-if="index === 0">
							<view class="body-box" v-for="(ite,ind) in item" :key="ind">
								<view class="item-box">
									<work-statu :obj="ite" page_type="1" @todetail="todetail" @toOrder="toOrder"></work-statu>
								</view>
							</view>
						</template>
						<template v-if="index === 1">
							<view class="body-box" v-for="(ite,ind) in item" :key="ind">
								<view class="item-box">
									<work-statu :obj="ite" page_type="2" @todes="todes" @topost="topost" @toreject="toreject" @todetail="todetail" @toOrder="toOrder"></work-statu>
								</view>
							</view>
						</template>
						<template v-if="index === 2">
							<view class="body-box" v-for="(ite,ind) in item" :key="ind">
								<view class="item-box">
									<work-statu :obj="ite" page_type="3" :is_user="is_user" @todetail="todetail" @toOrder="toOrder"></work-statu>
								</view>
							</view>
						</template>
						<template v-if="index === 3">
							<view class="body-box" v-for="(ite,ind) in item" :key="ind">
								<view class="item-box">
									<work-statu :obj="ite" page_type="4" @todetail="todetail" @toOrder="toOrder"></work-statu>
								</view>
							</view>
						</template>

					</template>
					<!--无数据-->
					<empty v-else no-full type="noData"></empty>
				</scroll-view>
			</swiper-item>
		</swiper>
		<!--编辑框-->
		<w-popup :show="showtip" :type="type1" @change="change1">
			<view class="w-tip">
				<view class="w-tit" v-if="tipType===1 || tipType===2">操作：{{tipType===1?'通过':tipType===2?'驳回':''}}</view>
				<view class="w-con">
					<view class="input-row" v-if="tipType===1 || tipType===2">
						<textarea class="input-row-w" v-model="params.mark" :placeholder="`批注:（${tipType===1?'非':''}必填）`" />
					</view>
				</view>
				<view class="w-but">
					<view class="w-but-txt" @click="cancel('tip')">取消</view>
					<view class="w-but-txt" @click="confirm">确认</view>
				</view>
			</view>
		</w-popup>
	</view>
</template>

<script>
	const util = require('../../common/util2.js');
	import refresh from '@/components/w-refresh/refresh.vue';
	import navTab from '@/components/w-navTab/navTab2.vue';
	import wSelSearch from '@/components/w-sel-logo/w-sel-search.vue'; //搜索
	import workStatu from '@/pages/components/work_statu.vue'; //工作动态
	import {
		mapGetters,
		mapActions
	} from "vuex";
	import {
		orderLists, //进行中、我的下单
		approvalOrderLists, //待审批、已审批订单
		assignUsers, //指派/驳回
		setSuppliers, //指派供应商
		orderCounts, //订单统计
		assignSuppliers, //供应商管理员指派供应商
		approvalSuppliers, //供应商员工通过驳回操作
		rejects, //驳回
	} from '@/common/api.js';
	import wPopup from '@/components/w-popup/w-popup2.vue'; // 编辑框
	export default {
		components: {
			refresh,
			navTab,
			wSelSearch,
			workStatu,
			wPopup
		},
		data() {
			return {
				noData: false,
				toView: '', //回到顶部id
				tabTitle: ['进行中', '待审批', '已审批', '我的下单'], //导航栏格式 --导航栏组件
				currentTab: 0, //sweiper所在页
				pages: [1, 1, 1, 1], //第几个swiper的第几页
				objlist: [[],[],[],[]], //数据格式
				page_type: '',
				userType: '', //system-首页 user-用户
				pageStatu: '0', //1-开权限 2-没有权限
				id: '',
				user_statu: {
					add_statu: false,
					replace_statu: false,
					stick_del_statu: false
				},
				ld_num: '0',
				cy_num: '0',
				active:0,
				seluser:{
					name:'',
					head:'',
					uid:0
				},
				params1:{
					type:'',
					company_id:'',
					task_name:'',
					order_type:'',
					time:'',
					page:1,
					limit:30
				},
				params2:{
					type:'',
					company_id:'',
					task_name:'',
					order_type:'',
					time:'',
					page:1,
					limit:30
				},
				params3:{
					type:'',
					company_id:'',
					task_name:'',
					order_type:'',
					time:'',
					page:1,
					limit:30
				},
				params4:{
					type:'',
					company_id:'',
					task_name:'',
					order_type:'',
					time:'',
					page:1,
					limit:30
				},
				params:{
					id:0,
					flow_status:'',
					mark:'',
					uid:'',
					name:'',
					supplier_id:'', //供应商组别id
					to_user:'', //要转发的供应商id 多个按逗号分隔
				},
				sel_user:[],
				sel_type:'',
				next_user:'', // 不为空为供应商成员 通过或驳回状态
				sel_id:'',
				next_type:'', // 0 为最后一个人
				user_type:'',

				tipType: 0, // 1-通过 2-驳回
				showtip: false, //是否显示弹窗2
				content1: '顶部弹 popup',
				type1: '', //弹窗显示方式
				pageobj: {
					name: '单选',
					type: 'radio',
					submenu: [{
							name: "排序规则",
							type:'time',
							submenu: [{
									name: "按时间升序",
									value: "asc",
									selected:false
								},
								{
									name: "按时间降序",
									value: "desc",
									selected:false
								}
							]
						},
						{
							name: "下单类型",
							type:'order_type',
							submenu: [{
									name: "全部",
									value: "",
									selected:false
								},
								{
									name: "POP",
									value: "1",
									selected:false
								},
								{
									name: "道具",
									value: "2",
									selected:false
								}
							]
						}
					]
				},
				is_user:0

			};
		},
		computed: {
			...mapGetters(['companyInfo', 'userInfo']),
		},
		onShow() {
			this.getcount();
		},
		onLoad(option) {
			this.is_user = this.userInfo.uid;
			console.log(222, option)
			this.params1.company_id = this.companyInfo.id;
			this.params2.company_id = this.companyInfo.id;
			this.params3.company_id = this.companyInfo.id;
			this.params4.company_id = this.companyInfo.id;
			if (option.currentTab) {
				this.currentTab = parseInt(option.currentTab);
				console.log(223,this.currentTab)
			}
			this.getdata();
		},
		methods: {
			//搜索
			search(res){
				console.log(1111,res.value)
				if(this.currentTab === 0){
					this.params1.task_name = res.value;
					this.params1.page = 1;
				}else if(this.currentTab === 1){
					this.params2.task_name = res.value;
					this.params2.page = 1;
				}else if(this.currentTab === 2){
					this.params3.task_name = res.value;
					this.params3.page = 1;
				}else if(this.currentTab === 3){
					this.params4.task_name = res.value;
					this.params4.page = 1;
				}
				this.getdata();
			},
			//获取统计数量
			getcount(){
				orderCounts({company_id:this.params1.company_id}).then(res=>{
					if(res.code === 2000){
						this.ld_num = res.data.haveOrder.toString();
						this.cy_num = res.data.waitOrder.toString();
					}
				})
			},
			//获取数据
			getdata(){
				if(this.currentTab === 0){
					this.params1.type = 1;
					orderLists(this.params1).then(res=>{
						if(res.code === 2000){
							console.log(111111111)
							const data = res.data.data.map((item)=>({
								...item
							}))
							this.objlist[this.currentTab] = data;

							this.$forceUpdate() //二维数组，开启强制渲染
						}
					})
				}else if(this.currentTab === 1){
					this.params2.type = 1;
					approvalOrderLists(this.params2).then(res=>{
						if(res.code === 2000){
							const data = res.data.data.map((item)=>({
								...item,
								user:[]
							}))
							if(data && data.length>0){
								data.forEach(ite=>{
									if(this.params.id != 0){
										if(this.sel_type === 'c' || this.sel_type === 'd' || this.sel_type === 'e'){
											if(this.params.id === ite.id){
												ite.user = this.sel_user
											}
										}
									}
								})
							}
							console.log(999,data)
							this.objlist[this.currentTab] = data
							this.$forceUpdate() //二维数组，开启强制渲染
						}
					})
				}else if(this.currentTab === 2){
					this.params3.type = 2;
					approvalOrderLists(this.params3).then(res=>{
						if(res.code === 2000){
							const data = res.data.data.map((item)=>({
								...item
							}))
							console.log(999,data)
							this.objlist[this.currentTab] = data
							this.$forceUpdate() //二维数组，开启强制渲染
						}
					})
				}else if(this.currentTab === 3){
					this.params4.type = 2;
					orderLists(this.params4).then(res=>{
						if(res.code === 2000){
							this.objlist[this.currentTab] = res.data.data
							this.$forceUpdate() //二维数组，开启强制渲染
						}
					})
				}
			},
			//指派用户返回数据
			resdata2(type,id,row){
				console.log(11,type,id,row,this.objlist[1])
				this.sel_type = type;
				if(type === 'c'){
					this.params.id = parseInt(id);
					this.params.uid = row[0].uid;
				}else if(type === 'd'){
					this.params.id = parseInt(id);
					this.params.supplier_id = row[0].group_id;
					this.params.uid = row[0].uid;
				}else if(type === 'e'){
					this.params.id = parseInt(id);
					let to_user = '';
					if(row && row.length>0){
						row.forEach(item=>{
							if(to_user === ''){
								to_user += item.uid
							}else{
								to_user += ',' + item.uid
							}
						})
					}
					this.params.to_user = to_user;
					this.params.uid = to_user;
				}
				if(this.currentTab === 1){
					this.sel_user = row;
					this.params2.page = 1;
					this.getdata();
				}
			},
			//跳转详细页
			todetail(row,page_type){
				uni.navigateTo({
					url: `/pages/work/workDetail?pageType=${row.type}&row=${JSON.stringify(row)}&page_type=${page_type}`
				})
			},
			//跳转再下一单
			toOrder(id,type,flow_path_id){
				console.log(3344,id,type)
				/* uni.navigateTo({
					url: `/pages/order/PopConfirmOrder?pageType=${type}&id=${id}&objdata=${JSON.stringify(this.objdata)}`
				}) */
				if(type=== 1){
					uni.navigateTo({
						url: `/pages/order/PropCreateOrder?pageType=pop&order_id=${id}&flow_path_id=${flow_path_id}`
					})
				}else{

					uni.navigateTo({
						url: `/pages/order/PropCreateOrder?pageType=prop&order_id=${id}&flow_path_id=${flow_path_id}`
					})
				}
			},
			//驳回
			toreject(id,next_user,next_type,is_last){
				//bj.is_last?'结束':'驳回'
				//this.next_user = next_user; // 不为空为供应商成员 通过或驳回状态
				this.next_type = next_type; // 0 为最后一个人
				this.sel_id = id;
				if(!!next_user){

				}else if(next_type===0){

				}else{
					console.log(is_last)
					if(this.params.uid === '' && is_last){
						uni.showToast({
							title:'请先指派人员！',
							icon:'none',
							duration:2000
						})
						return
					}
				}
				this.params.mark = '';
				this.showtip = true;
				this.content1 = 'center';
				this.type1 = 'center';
				this.tipType = 2;
			},
			//通过
			topost(id,next_user,next_type){
				console.log(55,id,next_user,next_type)
				this.next_user = next_user; // 不为空为供应商成员 通过或驳回状态
				this.next_type = next_type; // 0 为最后一个人
				//this.user_type = user_type; // 0 为最后一个人
				this.sel_id = id;
				if(!!next_user){

				}else if(next_type===0){

				}else{
					if(this.params.uid === ''){
						uni.showToast({
							title:'请先指派人员！',
							icon:'none',
							duration:2000
						})
						return
					}
				}
				this.params.mark = '';
				this.showtip = true;
				this.content1 = 'center';
				this.type1 = 'center';
				this.tipType = 1;
			},
			//通过/驳回
			confirm(){
				if(this.tipType === 1){ //通过
				this.params.flow_status = 1; //通过
				   if(!!this.next_user){ // 不为空为供应商成员 通过状态
				   this.params.id = parseInt(this.sel_id);
				   const {id,flow_status,mark} = this.params
					   approvalSuppliers({id,flow_status,mark}).then(res=>{
						   if(res.code === 2000){
						   	uni.showToast({
						   		title:'指派成功！',
						   		icon:'none',
						   		duration:2000
						   	})
						   	this.getcount()
						   	this.getdata();
						   }else{
						   	uni.showToast({
						   		title:res.msg,
						   		icon:'none',
						   		duration:2000
						   	})
						   }
					   })
				   }else  if(this.next_type===0 || (this.next_type===1 && this.user_type===2)){ // 不为空为供应商成员 通过状态
				   this.params.id = parseInt(this.sel_id);
				   this.params.uid = ''
				   const {id,flow_status,mark,uid} = this.params
					   assignUsers({id,flow_status,mark,uid}).then(res=>{
						   if(res.code === 2000){
						   	uni.showToast({
						   		title:'已通过！',
						   		icon:'none',
						   		duration:2000
						   	})
						   	this.getcount()
						   	this.getdata();
						   }else{
						   	uni.showToast({
						   		title:res.msg,
						   		icon:'none',
						   		duration:2000
						   	})
						   }
					   })
				   }else{
					   if(this.sel_type === 'c'){ //公司-公司
					   	const {id,flow_status,mark,uid} = this.params
					   	assignUsers({id,flow_status,mark,uid}).then(res=>{
					   		if(res.code === 2000){
					   			uni.showToast({
					   				title:'指派成功！',
					   				icon:'none',
					   				duration:2000
					   			})
					   			this.getcount()
					   			this.getdata();
					   		}else{
					   			uni.showToast({
					   				title:res.msg,
					   				icon:'none',
					   				duration:2000
					   			})
					   		}
					   	})
					   }else if(this.sel_type === 'd'){ //公司-供应商
					   	const {id,supplier_id,uid,flow_status,mark} = this.params
					   	setSuppliers({id,supplier_id,uid,flow_status,mark}).then(res=>{
					   		if(res.code === 2000){
					   			uni.showToast({
					   				title:'指派成功！',
					   				icon:'none',
					   				duration:2000
					   			})
					   			this.getcount()
					   			this.getdata();
					   		}else{
					   			uni.showToast({
					   				title:res.msg,
					   				icon:'none',
					   				duration:2000
					   			})
					   		}
					   	})
					   }else if(this.sel_type === 'e'){ //供应商-公司
					   	const {id,to_user,flow_status,mark} = this.params;
					   	assignSuppliers({id,to_user,flow_status,mark}).then(res=>{
					   		if(res.code === 2000){
					   			uni.showToast({
					   				title:'指派成功！',
					   				icon:'none',
					   				duration:2000
					   			})
					   			this.getcount()
					   			this.getdata();
					   		}else{
					   			uni.showToast({
					   				title:res.msg,
					   				icon:'none',
					   				duration:2000
					   			})
					   		}
					   	})
					   }
				   }
				}else if(this.tipType === 2){//驳回
				//判断是否写入批注
					if(!this.params.mark){
						uni.showToast({
							title:'请填写驳回原因！',
							icon:'none',
							duration:2000
						})
					} else {
						this.params.id = parseInt(this.sel_id);
						const {id,mark} = this.params;
							rejects({id,mark}).then(res=>{
								if(res.code === 2000){
									uni.showToast({
										title:'驳回成功！',
										icon:'none',
										duration:2000
									})
									this.getcount()
									this.getdata();
								}else{
									uni.showToast({
										title:res.msg,
										icon:'none',
										duration:2000
									})
								}
							})
						
					}
					
					
					/* this.params.flow_status = 2; //驳回
					if(!this.next_user){ // 不为空为供应商成员 通过状态
					this.params.id = parseInt(this.sel_id);
					const {id,flow_status,mark} = this.params
					approvalSuppliers({id,flow_status,mark}).then(res=>{
						if(res.code === 2000){
							uni.showToast({
								title:'驳回成功！',
								icon:'none',
								duration:2000
							})
							this.getcount()
							this.getdata();
						}else{
							uni.showToast({
								title:res.msg,
								icon:'none',
								duration:2000
							})
						}
					})
					}else  if(this.next_type===0){ // 不为空为供应商成员 通过状态
					this.params.id = parseInt(this.sel_id);
					this.params.uid = ''
					const {id,flow_status,mark,uid} = this.params;
						assignUsers({id,flow_status,mark,uid}).then(res=>{
							if(res.code === 2000){
								uni.showToast({
									title:'驳回成功！',
									icon:'none',
									duration:2000
								})
								this.getcount()
									this.getdata();
							}else{
								uni.showToast({
									title:res.msg,
									icon:'none',
									duration:2000
								})
							}
						})
					}else{
						if(this.sel_type === 'c'){ //公司-公司
							const {id,flow_status,mark,uid} = this.params
							assignUsers({id,flow_status,mark,uid}).then(res=>{
								if(res.code === 2000){
									uni.showToast({
										title:'驳回成功！',
										icon:'none',
										duration:2000
									})
									this.getcount()
									this.getdata();
								}else{
									uni.showToast({
										title:res.msg,
										icon:'none',
										duration:2000
									})
								}
							})
						}else if(this.sel_type === 'd'){ //公司-供应商
							const {id,supplier_id,uid,flow_status,mark} = this.params
							setSuppliers({id,supplier_id,uid,flow_status,mark}).then(res=>{
								if(res.code === 2000){
									uni.showToast({
										title:'驳回成功！',
										icon:'none',
										duration:2000
									})
									this.getcount()
									this.getdata();
								}else{
									uni.showToast({
										title:res.msg,
										icon:'none',
										duration:2000
									})
								}
							})
						}else if(this.sel_type === 'e'){ //供应商-公司
							const {id,to_user,flow_status,mark} = this.params;
							assignSuppliers({id,to_user,flow_status,mark}).then(res=>{
								if(res.code === 2000){
									uni.showToast({
										title:'驳回成功！',
										icon:'none',
										duration:2000
									})
									this.getcount()
									this.getdata();
								}else{
									uni.showToast({
										title:res.msg,
										icon:'none',
										duration:2000
									})
								}
							})
						}
					} */
				}
				this.showtip = false;
			},
			//跳转指派
			todes(row){
				console.log(333,row)
				if(row.user_type === 1 && row.next_type === 1){ //指派公司成员
				console.log('c')
					uni.navigateTo({
						url: `/pages/designate/des_two?id=${row.id}&flow_path_id=${row.flow_path_id}&type=c`
					})
				}else if(row.user_type === 1 && row.next_type === 2){ //指派供应商管理员
				console.log('d')
					uni.navigateTo({
						url: `/pages/designate/des_two?id=${row.id}&flow_path_id=${row.flow_path_id}&type=d`
					})
				}else if(row.user_type === 2 && row.next_type === 2){ //指派供应商成员
				console.log('e')
					uni.navigateTo({
						url: `/pages/designate/des_two?id=${row.id}&flow_path_id=${row.flow_path_id}&type=e`
					})
				}else if(row.user_type === 2 && row.next_type === 1){ //指派供应商成员
				console.log('f')
					uni.navigateTo({
						url: `/pages/designate/des_two?id=${row.id}&flow_path_id=${row.flow_path_id}&type=c`
					})
				}
			},
			//选中
			selectRadioLabel(box_index, label_index, selected){
				if(this.pageobj.submenu && this.pageobj.submenu.length>0){
					this.pageobj.submenu.forEach((item,index)=>{
						if(index === box_index){
							if(item.submenu && item.submenu.length>0){
								item.submenu.forEach((ite,ind)=>{
									if(label_index === ind){
										ite.selected = !selected
									}else{
										ite.selected = false
									}
								})
							}
						}
					})
				}
			},
			//重置筛选
			resetFilterData() {

			},
			//确认筛选
			setFilterData() {
				console.log(666,this.pageobj.submenu)
				let order_type = '';
				let time = '';
				if(this.pageobj.submenu && this.pageobj.submenu.length>0){
					this.pageobj.submenu.forEach((item,index)=>{
						if(item.type === 'time'){
							if(item.submenu && item.submenu.length>0){
								item.submenu.forEach((ite,ind)=>{
									if(ite.selected){
										time = ite.value;
									}
								})
							}
						}else if(item.type === 'order_type'){
							if(item.submenu && item.submenu.length>0){
								item.submenu.forEach((ite,ind)=>{
									if(ite.selected){
										order_type = ite.value;
									}
								})
							}
						}
					})
				}


				if(this.currentTab === 0){
					this.params1.order_type = order_type;
					this.params1.time = time;
					this.params1.page = 1;
				}else if(this.currentTab === 1){
					this.params2.order_type = order_type;
					this.params2.time = time;
					this.params2.page = 1;
				}else if(this.currentTab === 2){
					this.params3.order_type = order_type;
					this.params3.time = time;
					this.params3.page = 1;
				}else if(this.currentTab === 3){
					this.params4.order_type = order_type;
					this.params4.time = time;
					this.params4.page = 1;
				}
				this.getdata();
			},

			toTop() {
				this.toView = ''
				setTimeout(() => {
					this.toView = 'top' + this.currentTab
				}, 10)
			},
			changeTab(index) {
				console.log(444,index)
				this.currentTab = index;
				console.log(445,this.currentTab)
			},
			// 其他请求事件 当然刷新和其他请求可以写一起 多一层判断。
			isRequest() {
				return new Promise((resolve, reject) => {
					this.pages[this.currentTab]++
					if(this.currentTab === 0){
						this.params1.page ++
					}else if(this.currentTab === 1){
						this.params2.page ++
					}else if(this.currentTab === 2){
						this.params3.page ++
					}else if(this.currentTab === 3){
						this.params4.page ++
					}
					var _self = this
					setTimeout(() => {
						uni.hideLoading()
						/* uni.showToast({
							icon: 'none',
							title: `请求第${that.currentTab + 1 }个导航栏的第${that.pages[that.currentTab]}页数据成功`
						}) */
						let newData = [];
						if(this.currentTab === 0){
							this.params1.type = 1;
							orderLists(this.params1).then(res =>{
								if(res.code === 2000){
									newData = res.data.data;
									resolve(newData)
								}
							})
						}else if(this.currentTab === 1){
							this.params2.type = 1;
							approvalOrderLists(this.params2).then(res=>{
								if(res.code === 2000){
										newData = res.data.data;
										resolve(newData)
									}
								})
						}else if(this.currentTab === 2){
							this.params2.type = 2;
							approvalOrderLists(this.params3).then(res=>{
								if(res.code === 2000){
									newData = res.data.data;
									resolve(newData)
								}
							})
						}else if(this.currentTab === 3){
							this.params4.type = 2;
							orderLists(this.params4).then(res =>{
								if(res.code === 2000){
									newData = res.data.data;
									resolve(newData)
								}
							})
						}
					}, 1000)
				})
			},
			// swiper 滑动
			swiperTab(e) {
				console.log(111,e)
				var index = e.detail.current //获取索引
				this.$refs.navTab.longClick(index);
				if(this.currentTab === 0 && this.params1.page === 1){
					this.getdata();
				}else if(this.currentTab === 1 && this.params2.page === 1){
					this.getdata();
				}else if(this.currentTab === 2 && this.params3.page === 1){
					this.getdata();
				}else if(this.currentTab === 3 && this.params4.page === 1){
					this.getdata();
				}
			},
			// 加载更多 util.throttle为防抖函数
			lower1: util.throttle(function(e) {
				console.log(`加载${this.currentTab}`) //currentTab表示当前所在页数 根据当前所在页数发起请求并带上page页数
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				this.isRequest().then((res) => {
					let tempList = this.objlist
					tempList[this.currentTab] = tempList[this.currentTab].concat(res)
					console.log(tempList)
					this.objlist = tempList
					this.$forceUpdate() //二维数组，开启强制渲染
				})
			}, 300),
			//取消
			cancel() {
				this.show = false
				this.showtip = false
			},
			change1(e) {
				if (!e.show) {
					this.showtip = false
				}
			},
			//清空
			clear() {
				this.params.mark = '';
			},
			// 刷新touch监听
			refreshStart(e) {
				this.$refs.refresh.refreshStart(e);
			},
			refreshMove(e) {
				this.$refs.refresh.refreshMove(e);
			},
			refreshEnd(e) {
				this.$refs.refresh.refreshEnd(e);
			},
			isRefresh() {
				setTimeout(() => {
					uni.showToast({
						icon: 'success',
						title: '刷新成功'
					})
					this.$refs.refresh.endAfter() //刷新结束调用
				}, 1000)
			}
		}
	};
</script>

<style lang="scss">
	/* 提示窗口 */
	.w-tip {
		/* #ifndef APP-NVUE */
		display: flex;
		flex-direction: column;
		/* #endif */
		width: 70vw;
		border-radius: 10rpx;
		background-color: #fff;
		box-shadow: 0rpx 7rpx 7rpx 0rpx rgba(0, 0, 0, 0.1);
		margin: 30rpx auto 0;

		.w-tit {
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-3;
			line-height: 60rpx;
			height: 60rpx;
			margin-top: 20rpx;
			text-align: left;
			padding: 0 30rpx;
		}

		.w-but {
			display: flex;
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-b3;
			height: 84rpx;
			line-height: 84rpx;

			.w-but-txt {
				flex: 1;
				text-align: center;
				border-right: 1rpx solid #f5f5f5;
			}

			.w-but-txt:last-of-type {
				border-right: none;
			}
		}

		.w-con {
			display: flex;
			text-align: center;
			font-weight: 400;
			padding: 20rpx 30rpx;
			border-bottom: 1rpx solid #f5f5f5;

			.txt-row {
				width: 100%;
				text-align: center;
				font-size: 32rpx;
				color: $font-color-3;
			}

			.input-row {
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 100%;
				background: #fff;
				border-radius: 10rpx;
				background: $uni-bg-color-grey;

				.icon-tb3 {
					width: 34rpx;
					height: 34rpx;
					margin: 0 20rpx;
				}

				.input-row-w {
					padding:20rpx 30rpx;
					text-align: left;
					font-size: 28rpx;
					font-weight: 400;
					line-height: 20px;
					color: $font-color-9;
				}
			}
		}
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
		background: $uni-bg-color;
		display: block;
		position: sticky;
		top: 0rpx;
		z-index: 9999;
		overflow: hidden
	}

	.page-content {
		width: 100vw;
		height: 100%;
		font-size: 28upx;
		display: flex;
		flex-direction: column;
		background: $uni-bg-color-grey;

		.page-body {
			height: calc(100% - 180rpx - var(--status-bar-height));
		}

		.page-top {
			display: flex;
			flex-direction: column;
			box-sizing: content-box;
			background: $uni-bg-color;
			display: block;
			position: sticky;
			top: 0rpx;
			z-index: 2;
			border-bottom: 1rpx solid #F2F4F5;
		}
	}

	.body-box {
		padding-top: 30rpx;
		display: flex;
		flex-direction: column;

		.item-box {
			display: flex;
			margin: 0 30rpx 0rpx 30rpx;
			background: $uni-bg-color;
			box-shadow: 6rpx 6rpx 20rpx rgba(181, 181, 181, 0.14);
			border-radius: 10rpx;
		}
	}
</style>
